﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NewStartHanldingUI.Login;

namespace CrystalReportsManagementSystem
{
    public partial class LoginFrm : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void btnCancel_Click(object sender, EventArgs e)
        {
            this.txtUserCode.Text = "manager";
            this.txtPassword.Text = "manager";
        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            ILogin login = new NewStartHanldingUI.Login.Login();
            login.UserCode = this.txtUserCode.Text.Trim();
            login.Password = this.txtPassword.Text.Trim();
            login.LoginEvent += login_LoginEvent;
            string ErrorMessage = login.myLogin();
            if (string.IsNullOrWhiteSpace(ErrorMessage) != true)
            {
                Common.MessageBox.Show(this, ErrorMessage);
            }
        }
        void login_LoginEvent(object sender, LoginEventHandlerArgs e)
        {
            Response.Redirect("MainFrm.aspx",false);
        }

    }
}